/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package deadlocksim.backend.resources;

/**
 *
 * @author romilian
 */
public class ProcessResource 
{
    int typeID;
    int instanceID;
    
    public ProcessResource(int typeID)
    {
        this.typeID = typeID;
    }
    
    @Override
    public boolean equals(Object o)
    {
        // Return true if and only if the typeID is the same
        if( o instanceof ProcessResource 
                && ((ProcessResource)o).typeID == typeID )
        {
            //System.out.println("In ProcessResource equals (TRUE): typeID 1, 2 = " 
              //      + typeID + " " + ((ProcessResource)o).typeID );
            return true;
        }
        else
        {
            //System.out.println("In ProcessResource equals (FALSE): typeID 1, 2 = " 
            //        + typeID + " " + ((ProcessResource)o).typeID );
            
            return false;
    }
        }

    public int getTypeId()
    {
        return typeID;
    }
    
    @Override
    public int hashCode() {
        int hash = 5;
        hash = 29 * hash + this.typeID;
        return hash;
    }
    
    @Override
    public String toString()
    {
        return ""+typeID;
    }
}
